<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link href="./css/simple-line-icons.css" rel="stylesheet">
    <link href="./css/style.css" rel="stylesheet">
</head>

<body class="app flex-row align-items-center">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-4">
                <div class="card-group mb-0">
                    <div class="card p-2">
                        <div class="card-block">
                            <p class="text-muted">随便输入账号和密码</p>
                            <div class="input-group mb-1">
                                <span class="input-group-addon"><i class="icon-user"></i>
                                </span>
                                <input type="text" class="form-control" id="userid" placeholder="账号">
                            </div>
                            <div class="input-group mb-2">
                                <span class="input-group-addon"><i class="icon-lock"></i>
                                </span>
                                <input type="password" class="form-control" placeholder="密码">
                            </div>
                            <div class="row">
                                <div class="col-6">
                                    <button type="button" class="btn btn-primary px-2" onclick="login()">登录</button>
                                </div>
                                <div class="col-6 text-right">
                                    <button type="button" class="btn btn-link px-0">忘记密码?</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap and necessary plugins -->
    <script src="./js/jquery.js"></script>
    <script src="./js/apiservice.js"></script>
    <script>
        function login() {
            var userid = $("#userid").val();
            if(! userid){
                alert("请填写账号");
                return ;
            }

            dataservice.login($("#userid").val(), function(){
                location.href = "index.html";
            });
        }
    </script>
</body>

</html>
